var timestamp=Date.parse(new Date());
var webSocket=new WebSocket("ws://127.0.0.1:8080/OschinaSvnJavaBlog/websocket/"+document.getElementById("message").getAttribute("data-timestamp")+"/"+document.getElementById("message").getAttribute("data-id"));
 
    webSocket.onerror = function(event) {
       alert(event.data);
    };
 
    webSocket.onopen = function(event) {
      document.getElementById("msg").innerHTML="已连接聊天室！";
    };
 
    webSocket.onmessage = function(event) {
      document.getElementById("msg").innerHTML+="<br/>" + event.data;
};
    
   